package com.example.SBootDemo.model.function;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;



@Entity
@Table(name="function")
public class function {
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private int id;
	
	private String url;
	
	private String modulename;
	
	private int pid;
	
	private String notes;
	
	private String funname;
	
	//是否启用
	private int station;
	
	
	 @ManyToMany                                      //多对多关系  
     
	 @JoinTable(name="role_function",                     //中间表的名称
	             joinColumns={@JoinColumn(name="function_id")},   //本表与中间表的外键对应关系
	             inverseJoinColumns={@JoinColumn(name="role_id")}) //另一张表与中间表的外键的对应关系
	 List<role> rolelist = new ArrayList<>();
	
	
	 
	 
	 
	 
	public List<role> getRolelist() {
		return rolelist;
	}




	public void setRolelist(List<role> rolelist) {
		this.rolelist = rolelist;
	}




	public int getId() {
		return id;
	}




	public void setId(int id) {
		this.id = id;
	}




	public String getUrl() {
		return url;
	}




	public void setUrl(String url) {
		this.url = url;
	}




	public String getModulename() {
		return modulename;
	}




	public void setModulename(String modulename) {
		this.modulename = modulename;
	}




	public int getPid() {
		return pid;
	}




	public void setPid(int pid) {
		this.pid = pid;
	}




	public String getNotes() {
		return notes;
	}




	public void setNotes(String notes) {
		this.notes = notes;
	}




	public String getFunname() {
		return funname;
	}




	public void setFunname(String funname) {
		this.funname = funname;
	}




	public int getStation() {
		return station;
	}




	public void setStation(int station) {
		this.station = station;
	}




	public function() {
	
	}




	public function(int id, String url, String modulename, int pid, String notes, String funname, int station) {
		super();
		this.id = id;
		this.url = url;
		this.modulename = modulename;
		this.pid = pid;
		this.notes = notes;
		this.funname = funname;
		this.station = station;
	}




	@Override
	public String toString() {
		return "function [id=" + id + ", url=" + url + ", modulename=" + modulename + ", pid=" + pid + ", notes="
				+ notes + ", funname=" + funname + ", station=" + station + ", rolelist=" + rolelist + "]";
	}
	
	
	
	
	
}
